project_dir = os.scriptdir()
project_name = project_dir:match(".+[/\\]([%w_]+)")

csdk_root = "../../" --csdk根目录,可自行修改
includes(csdk_root.."csdk.lua")
description_common()

target(project_name,function()
    set_kind("static")
    set_targetdir("$(buildir)/".. project_name .. "/")
    description_csdk()
    -- set_warnings("error")

    add_includedirs("./inc",{public = true})
    add_files("./src/*.c",{public = true})
    add_defines("LUAT_USE_TLS",{public = true})
    add_includedirs(csdk_root.."/thirdparty/LinkSDK/core",{public = true})
    add_includedirs(csdk_root.."/thirdparty/LinkSDK/core/utils",{public = true})
    add_includedirs(csdk_root.."/thirdparty/LinkSDK/core/sysdep",{public = true})
    add_includedirs(csdk_root.."/thirdparty/LinkSDK/components/data-model",{public = true})
    add_includedirs(csdk_root.."/thirdparty/LinkSDK/components/dynreg",{public = true})
    add_includedirs(csdk_root.."/thirdparty/LinkSDK/components/dynreg-mqtt",{public = true})
    add_includedirs(csdk_root.."/thirdparty/LinkSDK/components/ota",{public = true})
    add_files(csdk_root.."/thirdparty/LinkSDK/core/utils/*.c")
    add_files(csdk_root.."/thirdparty/LinkSDK/core/*.c")
    add_files(csdk_root.."/thirdparty/LinkSDK/core/sysdep/*.c")
    add_files(csdk_root.."/thirdparty/LinkSDK/external/*.c",{public = true})
    add_files(csdk_root.."/thirdparty/LinkSDK/components/data-model/*.c",{public = true})
    add_files(csdk_root.."/thirdparty/LinkSDK/components/dynreg/*.c",{public = true})
    add_files(csdk_root.."/thirdparty/LinkSDK/components/dynreg-mqtt/*.c",{public = true})
    add_files(csdk_root.."/thirdparty/LinkSDK/components/ota/*.c",{public = true})
    add_files(csdk_root.."/thirdparty/LinkSDK/portfiles/aiot_port/*.c",{public = true})
end)
